package com.javalab._2basic;

public class _2BasicOperateTest {
    public static void main(String[] args) {
        // 加减乘除 与 赋值运算
        int a = 1 + 1;
        int b = a + 1;
        int c = b - 1;
        int d = c * 2;
        int e = d / 2;

        // 大小比较
        System.out.println( 1 > 0 );
        System.out.println( 2 < 0 );
        System.out.println( 3 == 0);
        System.out.println( 4 >= 0);
        System.out.println( 5 <= 0);
        System.out.println( 6 != 0);

        // 逻辑运算
        System.out.println(true | false);
        System.out.println(true & false);
        // 短路运算
        System.out.println(true || (1 > 2));
        System.out.println(false && (1 > 2));

        // 双目运算符
        int f = (1 > 0) ? 1 : 0;

        // += -= *= /=
        a = a + b;
        a+=b;

        // ++ -- ** //
        a = 0;
        System.out.println(a++);
        a = 0;
        System.out.println(++a);

    }
}
